package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.uuid.Seq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysOrgCertificateMapper;
import com.ruoyi.system.api.domain.SysOrgCertificate;
import com.ruoyi.system.service.ISysOrgCertificateService;

/**
 * 机构资质Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-07
 */
@Service
public class SysOrgCertificateServiceImpl implements ISysOrgCertificateService 
{
    @Autowired
    private SysOrgCertificateMapper sysOrgCertificateMapper;

    /**
     * 查询机构资质
     * 
     * @param certificateId 机构资质主键
     * @return 机构资质
     */
    @Override
    public SysOrgCertificate selectSysOrgCertificateByCertificateId(Long certificateId)
    {
        return sysOrgCertificateMapper.selectSysOrgCertificateByCertificateId(certificateId);
    }

    @Override
    public List<SysOrgCertificate> selectSysOrgCertificateList(SysOrgCertificate sysOrgCertificate) {
        return null;
    }


    /**
     * 新增机构资质
     * 
     * @param sysOrgCertificate 机构资质
     * @return 结果
     */
    @Override
    public int insertSysOrgCertificate(SysOrgCertificate sysOrgCertificate)
    {
        sysOrgCertificate.setCreateTime(DateUtils.getNowDate());
        sysOrgCertificate.setCertificateId(Seq.getId());
        return sysOrgCertificateMapper.insertSysOrgCertificate(sysOrgCertificate);
    }

    /**
     * 修改机构资质
     * 
     * @param sysOrgCertificate 机构资质
     * @return 结果
     */
    @Override
    public int updateSysOrgCertificate(SysOrgCertificate sysOrgCertificate)
    {
        return sysOrgCertificateMapper.updateSysOrgCertificate(sysOrgCertificate);
    }

    /**
     * 批量删除机构资质
     * 
     * @param certificateIds 需要删除的机构资质主键
     * @return 结果
     */
    @Override
    public int deleteSysOrgCertificateByCertificateIds(String[] certificateIds)
    {
        return sysOrgCertificateMapper.deleteSysOrgCertificateByCertificateIds(certificateIds);
    }

    /**
     * 删除机构资质信息
     * 
     * @param certificateId 机构资质主键
     * @return 结果
     */
    @Override
    public int deleteSysOrgCertificateByCertificateId(Long certificateId)
    {
        return sysOrgCertificateMapper.deleteSysOrgCertificateByCertificateId(certificateId);
    }
}
